import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralFlowNodeConfig = (params) => {
  params.head.transCode = 'queryGeneralFlowNodeConfig';
  return request({
    url: '/general/generalFlowNodeConfig/queryGeneralFlowNodeConfig',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralFlowNodeConfigListPage = (params) => {
  params.head.transCode = 'queryGeneralFlowNodeConfigListPage';
  return request({
    url: '/general/generalFlowNodeConfig/queryGeneralFlowNodeConfigListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralFlowNodeConfig = (params) => {
  params.head.transCode = 'saveGeneralFlowNodeConfig';
  return request({
    url: '/general/generalFlowNodeConfig/saveGeneralFlowNodeConfig',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralFlowNodeConfigList = (params) => {
  params.head.transCode = 'saveGeneralFlowNodeConfigList';
  return request({
    url: '/general/generalFlowNodeConfig/saveGeneralFlowNodeConfigList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralFlowNodeConfig = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralFlowNodeConfig';
  return request({
    url: '/general/generalFlowNodeConfig/saveOrUpdateGeneralFlowNodeConfig',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralFlowNodeConfigList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralFlowNodeConfigList';
  return request({
    url: '/general/generalFlowNodeConfig/saveOrUpdateGeneralFlowNodeConfigList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralFlowNodeConfig = (params) => {
  params.head.transCode = 'updateGeneralFlowNodeConfig';
  return request({
    url: '/general/generalFlowNodeConfig/updateGeneralFlowNodeConfig',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralFlowNodeConfig = (params) => {
  params.head.transCode = 'deleteGeneralFlowNodeConfig';
  return request({
    url: '/general/generalFlowNodeConfig/deleteGeneralFlowNodeConfig',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralFlowNodeConfigList = (params) => {
  params.head.transCode = 'deleteGeneralFlowNodeConfigList';
  return request({
    url: '/general/generalFlowNodeConfig/deleteGeneralFlowNodeConfigList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralFlowNodeConfigExcel = (params) => {
  downloadExcel({
    url: '/general/generalFlowNodeConfig/excelDownload/exportGeneralFlowNodeConfigExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
